home *** CD-ROM | disk | FTP | other *** search
- Documentation for sample.exe, a program
- written by Helge Hafting.
-
- There are 2 executable files:
- sample_n.exe - with norwegian texts.
- sample_e.exe - with english texts.
- Install the one you want to use and rename it to sample.exe
-
- sample.exe is a program for high-speed 8-bit sampling under
- os/2. The program turn the pc into a simple & cheap logic
- analyzer, maybe useable for hobby electronics and such.
- Sampling rates of approximately 700kB/s has been achieved
- on a 25MHz 386sx, with ISA bus.
-
- Sampled data may be viewed as 8 bits that take the values
- 0 and 1, or as a continous graph. The latter is useful if the
- data is sampled from a DA converter.
-
- The program can be set up for sampling from any I/O address,
- so it will work with any i/o card that provides input at an
- i/o address. Even a standard parallel port (printer port) may
- be used.
-
-
- USING THE PROGRAM
-
- The program has a PM interface, and should therefore be
- almost self-explanatory. Experiment a bit, and you'll learn it.
- Numbers (such as the sample buffer size) are converted by the
- c function strtoul(). They can be decimal without a
- leading 0: 1024, hex with the 0x prefix: 0x800 or
- octal with a leading 0: 02000.
-
- The data is displayed in two windows. One is a digital
- representation showing each bit. The other is an analog
- representation, assuming that you are using a DA converter.
- (Be sure that you connect the LSB of the DA to the LSB of the
- digital port, or the data will look very strange.)
- Both windows are scrolled with a scroll bar below them.
- There is also a slider between the windows. It is used to drag
- a 1-sample wide line across the data windows, making it easier
- to see exactly where data changes. It is also possible to zoom
- in on data, using the zoom menu.
-
- The program has three ways of searching through sampled data:
- "x=a" This is an exact match. Type in the byte value you
- want to find, and start the search.
- "a<=x<=b" Type in upper and lower limits, and start the search.
- This is useful for analog signals sampled with a DA converter.
- "01*" This is useful if you are looking for situations where
- some bits are 0, some are 1, and some are don't care conditions.
- Use the radio button array and specify 1, 0 or * (don't care)
- for each bit. Pressing the search button again will bring
- you to the next sample that matches the search criteria.
-
- Interactive help and file operations are not implemented yet.
-
- For a quick test, use configure to set the sample buffer to
- 100kB and the i/o port to 64. Then press ok in the configure
- dialog, and press the sample button.
-
-
- TECHNICAL INFO:
-
- Sampling rate:
- The program use the rep insb instruction for sampling. A 386
- uses 6 clocks per sample, a 486 uses 8 clocks per sample.
- A 386 may therefore sample faster than a 486. The 486 is
- optimized for other things than I/O. You will usually get
- sampling rates lower than cpuclock/6, as the cpu isn't the only
- limit. An ISA bus run at only 8MHz, and has several waitstates
- per 8-bit i/o address access. I haven't tested EISA,MCA or
- local bus sampling. RAM speed and possibly waitstates inserted
- by the i/o card will also limit sampling speed.
- If you want to find out what sampling rate you get with
- your particular machine, try sampling a signal (preferably a
- square wave) with a known frequency. 100kHz is a good test
- frequency.
- You may loose a few samples now and then because of ram refresh.
- You will also loose 1-2 samples per 4k block, when the MMU
- has to read a new page table entry.
-
-
- Os/2 considerations:
- The program achieves its high sampling rate by using all
- the cpu time when sampling. You will see that the mouse stop
- responding a few seconds if you sample several megabytes.
- The program reserves the cpu by turning off interrupts during
- sampling, this is a somewhat nasty thing to do. There will be
- no multitasking or running of background programs when sampling
- is going on. Even device drivers will stop.
- Processor exceptions and non-maskable interrupts can still
- occur. This is a problem, because os/2 will re-enable
- interrupts and resume multitasking if it gets an NMI or
- exception. This will give strange sampled data, as the machine
- will sample at full speed for 1 timeslice (usually 30ms), then
- do something else for a while, then sample at full speed another
- time slice, and so on.
- NMI's don't usually happen, unless your machine is equipped
- with a watchdog timer. The only processor exception you may get
- is page faults. The sample buffer must be allocated in real memory, virtual memory on disk won't work. This is because:
- 1. Os/2 re-enables interrupts after a page fault.
- 2. The time needed to get a page from disk is long, tens of
- thousands of samples will be lost.
- You will know that a page fault happened if you get disk
- accesses during sampling. If that happens, try again with a
- smaller buffer. Allocating 3MB on an 8MB machine seems to work
- fine.
-
- The scroll bar will probably not work properly with buffers
- larger than 14MB, due to PM limitations.
-
-
- PLANNED FUTURE ENHANCEMENTS:
- (not in order of priority.)
-
- 1. Enabling all the menu choices etc. that currently don't
- do anything, such as help and a possibility to save
- and load data.
-
- 2. Optional slower sampling. Many uses don't require 700kB/s.
- If you want to take a look at the serial port (in order to
- find out why a modem connection don't work), then a lower
- rate could be useful.
-
- 3. Changing colors and resizing the window.
-
- 4. Support for setting up i/o cards: Some i/o cards may require
- that certain values are written to certain i/o ports or
- memory addresses before sampling can be done. (In order to
- set up a port as an input, for example.)
-
- 5. 16-bit and 32-bit sampling. 32-bit won't be very useful
- on an ISA bus. 16-bit sampling may be faster than 8-bit
- on an ISA bus, as fewer waitstates are specified for 16-bit
- i/o...
-
- 6. Automatic trigging. For now, you have to use the sample
- button, the menu or ALT S in order to start sampling.
-
- 7. Fix known bugs, such as:
- a: the window don't look good in 1024x768 resolution
- b: The slider may get wrong size when zooming, if you are
- using better than 640x480 resolution.
- c: Moving the slider around sometimes leaves a black line
- that shouldn't be there.
- d: english texts are sometimes a little too long.
-
- None of these enhancements are difficult to implement. But my
- time is limited, so I will only implement what people want.
- Feel free to mail me and suggest improvements.
- ---------------
-
- This is a shareware program. You may freely use and copy it
- as much as you want. Please include this text with any copies.
-
- Commercial users will have to pay me $10 in order to use the program commercially in any way. Use the snail mail
- address when sending money.
-
- The program will be updated according to what people want. So
- mail me if you have suggestions, questions, or bug reports,
- or find the program useful.
-
- My email addresses are:
- hafting@idt.unit.no
- hafting@pvv.unit.no
- I won't be available on the internet forever. If the above
- addresses don't work, try my snail mail address:
-
- ---------------------
- | Helge Hafting |
- | Poverudvn. 22 |
- | N-3440 R¢yken |
- | NORWAY |
- ---------------------
-
- (The "¢" in "R¢yken" is supposed to be an "o" with
- a slash through it. If this is a problem, use an
- ordinary "o" instead.)
-
-
-